<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div class="wrap">
    <div class="guimeilogo"></div>
    <div class="register">

        <div class="top">
            <h1>新用户注册</h1>
            <a href="/shop/views/login.jsp">已有账号</a>
        </div>

        <div class="mid">
            <form action="/shop/register" method="post">
                <input type="text" name="username" id="username" placeholder="亲，您的昵称" required="required" />
                <div id="showMessage"></div>

                <input type="password" name="password" id="password" placeholder="密码" required="required" />

                <input type="text" name="email" id="email" placeholder="邮箱" required="required" />

                <input type="text" name="telephone" id="telephone" placeholder="手机号" required="required"/>

                <div class="sec">

                    <input type="text" name="code" id="code" placeholder="验证码" required="required" />

                    <a  class="send" onclick="send()"> 发送验证码 </a>

                    <script>
                        function send(){

                            return false;
                        }
                    </script>
                </div>
                <input type="submit" id="submit" value="注册"/>

            </form>
        </div>
    </div>
</div>
<script src="js/jquery-2.1.0.js"></script>
<script>
    username.onblur = function () {
        $.post("/shop/chexkusername" ,{username:this.value }, function (date) {
            if ( date.code == "10010" ){
                $("#showMessage").html("对不起，此用户名已经被使用").css("color","red");
            } else{
                $("#showMessage").html("该用户名可以使用").css("color","blue")
            }
        });
    }
</script>
</body>

</body>
</html>
